.post
  %p.post_title
    = @media.category.image=="" ? link_to(@media.category.name, url_for(:controller=>"media",:action=>"category",:id=>@media.category.name)) : link_to(image_tag(@media.category.image,:border =>0), url_for(:controller=>"media",:action=>"category",:id=>@media.category.name)) 
    = " "
    = link_to h(HTMLEntities.decode_entities(@media.title)), url_for(:controller=>@media.permalink)
  %p.post_details
    =_ '(date)', @media.creation 
    = " "
    = theme_image_tag "user.png",:border=>0 
    = @media.user.login 
    = " "
    = theme_image_tag "folder.png",:border=>0 
    = link_to @media.category.name, url_for(:controller=>"media",:action=>"category",:id=>@media.category.name)
  .post_text= find_and_preserve(RedCloth.new(HTMLEntities.decode_entities(@media.text)).to_html)
  %p.post_details
    = link_to _("comments"), url_for(:controller=>@media.permalink+"/#comments")
    = ":"
    = @media.comments.find(:all,:conditions=>"published=1 and banned=0").size
    = " "
    = link_to _("Add comment"),:controller=>"comment",:action=>"new",:id=>@media.id 
    = " "
    = link_to _("permalink"), @settings.url.to_s+"/"+@media.permalink 
    = " tags:"+@media.tags.collect{|t| link_to(t.name,url_for(:controller=>"media",:action=>"tag",:id=>t.name))}.join(" ") unless @media.tags.count==0 
    
